import View from "./ExampleGridServerCrossPageCheck.view";

interface INP {

}

@YvanUI.BizModule()
export default class Module extends View<Module, INP> {

    onLoad(): void {
        super.onLoad();
    }

    click1() {
        this.refs.theGrid.reload();
    }

    gridRowDetail(sender: YvanUI.CtlGrid, args: YvanUI.CtlGridRowButtonClickArgs) {
        YvanUI.msg(`查看行详情 ${args.data.user_id}`);
    }

    gridDelete(sender: YvanUI.CtlGrid, args: YvanUI.CtlGridRowButtonClickArgs) {
        YvanUI.confirm(`真的要删除 "${args.data.staff_name}" ?`).then(() => {
            YvanUI.msg(`行删除 ${args.data.user_id}`);
        });
    }

    btnGetCheckedRowsOnClick() {
        console.log("GetCheckedRows:", this.refs.theGrid.getCheckedRows());
    }

    btnGetAllCheckedRowsOnClick() {
        console.log("GetAllCheckedRows:", this.refs.theGrid.getAllCheckedRows());
    }

    btnSetCheckedRowsOnClick() {
        this.refs.theGrid.setCheckedIds(['100000', '100001', '100002']);
    }
}